import convert_candidate_file
import pipeline
from easy_io import H5Writer
from prepare_h5_file_with_interpolation_with_multiple_h5 import gen


convert_candidate_file.main(
    infile='../../data/faster_rcnn_candidates/candis_v9_stage2.pkl',
    outfile='../../data/tmp_fp_reduction/kaggle_stage2_candidates_v3.pkl'
)
convert_candidate_file.main(
    infile='../../data/faster_rcnn_candidates/candis_v15_stage2.pkl',
    outfile='../../data/tmp_fp_reduction/kaggle_stage2_candidates_v9.pkl'
)

pipeline.main(
    infile='../../data/tmp_fp_reduction/kaggle_stage2_candidates_v3.pkl',
    outfile='../../data/tmp_fp_reduction/kaggle_stage2_candidates_v4.pkl',
)
pipeline.main(
    infile='../../data/tmp_fp_reduction/kaggle_stage2_candidates_v9.pkl',
    outfile='../../data/tmp_fp_reduction/kaggle_stage2_candidates_v10.pkl',
    apply_merge=False,
)

H5Writer(
    '../../data/tmp_fp_reduction/kaggle_stage2_candidates_v4.hdf5',
    'w',
    gen(
        candidate_pkl_file='../../data/tmp_fp_reduction/kaggle_stage2_candidates_v4.pkl',
        data_h5_files={
            'stage2': '../../data/stage2/vol.hdf5',
        },
        min_edge_length=68,
    )
)
H5Writer(
    '../../data/tmp_fp_reduction/kaggle_stage2_candidates_v10.hdf5',
    'w',
    gen(
        candidate_pkl_file='../../data/tmp_fp_reduction/kaggle_stage2_candidates_v10.pkl',
        data_h5_files={
            'stage2': '../../data/stage2/vol.hdf5',
        },
        min_edge_length=68,
    )
)

